import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import TreeTable from 'vue-table-with-tree-grid'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './assets/css/global.css'
import $api from './http/api'
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
Vue.component('tree-table', TreeTable)

Vue.use(VueQuillEditor)
Vue.use(ElementUI)
Vue.config.productionTip = false
Vue.prototype.$api = $api
Vue.filter('dateFormat',function(val) {

  let dt = new Date(val)
  let year = dt.getFullYear()
  let month = (dt.getMonth()+1 +'').padStart(2,0)
  let day = (dt.getDate()+'').padStart(2,0)
  let hours = (dt.getHours()+'').padStart(2,0)
  let minutes = (dt.getMinutes()+'').padStart(2,0)
  let second = (dt.getSeconds()+'').padStart(2,0)
  
  return `${year}-${month}-${day} ${hours}:${minutes}:${second}`
})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
